<template>
    <view class="bg-white">
        <custom :float="true"></custom>
        <view class="bg-img" style="width:750rpx;height:350rpx;background-image: url(../../../../static/image/user/promote-gift-list/logo.png);">
        </view>
        <view class="bg-white margin-lr-26 radius-16 shadow-warp" style="margin-top: -150rpx; height: 280rpx; position: relative;">
            <view class="padding-30 flex justify-between">
                <view>
                    <view class="text-xl text-bold text-cut-1" style="width: 490rpx;">推广礼包</view>
                    <view class="text-sm margin-top-10 line-height-16em">
                        1.购买推广礼包可成为推广专员或城市合伙人<br>
                        2.成为城市合伙人可自动成为推广专员<br>
                        3.你推荐的人购再买礼包你可以获得一些推广奖励，可用于兑换金券或提现红包
                    </view>
                </view>
                <view class="margin-left-10">
                    <image class="radius-16" style="width: 150rpx; height: 150rpx;" src="../../../../static/image/user/promote-gift-list/logo.png"></image>
                </view>
            </view>
            <!--            <view @tap="seller_info_dialog = true" class="text-sm text-gray" style="position: absolute; bottom: 30rpx; right: 30rpx;">
                <text>详细规则</text>
                <text class="cuIcon-unfold padding-left-6"></text>
            </view> -->
        </view>
        <view class="padding-lr-30 padding-top-40">
            <list :list="data.list" empty_list_title="还没有推广礼包">
                <template #list>
                    <view @tap="$store.commit('userNavTo', '/user/promote/gift/info?gift_id='+info.gift_id)" v-for="(info, key) in data.list"
                        :key="key" class="flex padding-bottom-30">
                        <view>
                            <image class="radius-10" style="width: 260rpx; height:260rpx;" :src="info.logo | ossUrl(260)"></image>
                        </view>
                        <view class="margin-left-20 flex flex-direction justify-between">
                            <view>
                                <view class="text-lg text-bold text-cut-2" style="width: 410rpx;">{{info.name}}</view>
                                <view class="text-gray text-13 margin-top-16 text-cut-2" style="width: 410rpx;">{{info.content}}</view>
                                <view class="text-gray text-13 margin-top-14">
                                    <view class="cu-tag bg-nddyny" v-if="info.gift_type == 0">区域代理</view>
                                    <view class="cu-tag bg-nddyny" v-if="info.gift_type == 1">城市合伙人</view>
                                    <view class="cu-tag" v-if="info.limit_amount_only > 0">永久限购次数
                                        {{info.limit_amount_only}}</view>
                                </view>
                                <view class="text-nddyny text-sm margin-top-14" v-if="info.reward_amount > 0">
                                    <text class="text-bold">推荐人</text>奖励
                                    <text class="margin-left-10">
                                        推广额度 {{info.reward_amount | floor}}
                                    </text>
                                </view>
                                <view class="text-nddyny text-sm margin-top-14" v-if="info.reward_gold_share_amount > 0">
                                    <text class="text-bold">购买人</text>奖励
                                    <text class="margin-left-10">
                                        金股数量 {{info.reward_gold_share_amount | floor}}
                                    </text>
                                </view>
                            </view>
                            <view class="margin-top-10 flex justify-between align-center">
                                <view class="text-nddyny text-bold">
                                    <text>￥</text>
                                    <text class="text-xl">{{info.price | floor}}</text>
                                </view>
                                <view>
                                    <nButton class="sm round" title="查看详情"></nButton>
                                </view>
                            </view>
                        </view>
                    </view>
                </template>
            </list>
        </view>
        <nBar title="奖励规则"></nBar>
        <nDesc>
            <template #top>
                一、推广商家奖励
            </template>
            <template #bottom>
                1、每推广一个有效商家奖励1至5个金股(详见商家推广活动)<br>
                2、奖励该商家赠送金券数量的6%金券
            </template>
        </nDesc>
        <nDesc>
            <template #top>
                二、推广专员奖励
            </template>
            <template #bottom>
                1、每推广一个消费股东，奖励1-5个金股<br>
                2、奖励该股东日常消费时商家赠送金券数量的8%金券奖励<br>
                3、如果你是推广专员，你推广的股东成为专员时，你可以获得一些推广奖励，可用于兑换金券或提现红包（推广奖励数量和你推广的股东购买的礼包有关）
            </template>
        </nDesc>
        <nDesc class="padding-bottom-30">
            <template #top>
                三、对推广商家入驻的市场开发补贴
            </template>
            <template #bottom>
                1、跟公司签订市场开发合同的推广专员。将给予20000至50000的市场开发费用。<br>
                2、对前十名达到业绩的推广专员配备红旗H9汽车一部。<br>
                3、推广专员同时还可享受推广会员和推广商户给予的全部奖励。<br>
                4、每推荐一名合格的市场开发专员，将给予推荐人2000至5000的奖励。
            </template>
        </nDesc>

        <!--        <view class="cu-modal bottom-modal" :class="seller_info_dialog==true?'show':''" @tap="seller_info_dialog = false">
            <view class="cu-dialog">
                <view class="cu-bar">
                    <view class="content text-cut-1" style="width: 600rpx;">推广礼包</view>
                    <view class="action"></view>
                    <view class="action" @tap="seller_info_dialog = false"><text class="cuIcon-close text-red"></text></view>
                </view>
                <view class="padding-lr-30 text-left">
        
                </view>
            </view>
        </view> -->
    </view>
</template>

<script>
    export default {
        data() {
            return {
                // seller_info_dialog: false,
                data: {
                    offset: 0,
                    limit: 0,
                    stop: false,
                    list: [],
                },
            }
        },
        onLoad(params) {
            this.getList(this.$api.list_action_init);
        },
        methods: {
            getList(action) {
                this.$api.list(this, {
                    action,
                    url: '/user/PromoterGift/list',
                    success: (Result) => {
                        if (this.$api.form.toast(this, Result)) return;
                        this.data.list = this.data.list.concat(Result.result.list);
                    }
                });
            }
        }
    }
</script>
